import type { Slide } from '@/types/slides'
import { GetTemplateItemData } from './checkTemplate'
import { nanoid } from 'nanoid'

export async function GetEndCourseware(tempId: string): Promise<Slide | undefined> {
  const tempData = await GetTemplateItemData(tempId, 'end')
  if (!tempData) return

  const data = tempData.default

  data.id = nanoid(10)
  return data
}